package main

import (
	"fmt"
	"net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
	location := r.URL.Query().Get("location")
	// 重定向到指定URL
	http.Redirect(w, r, location, http.StatusFound)
}

func main() {
	http.HandleFunc("/redirect", handler)
	fmt.Println("Starting server on :9000")
	if err := http.ListenAndServe(":9000", nil); err != nil {
		fmt.Println(err)
	}
}